import 'create_user_info_model.dart';

class EditCircle {
  String id = "0";
  String ada = "";
  String amwayId = "3609999999907001";
  String auditStatus;
  String autoPublish;
  int createTime = 0;
  String description = "";
  List<DisplayAudits> displayAudits = [];
  List<ImagesBean> medias = [];
  String officialFlag;
  String officialPgcId = "";
  List<Products> products = [];
  String publishStatus;
  String title = "";

  EditCircle(
      {this.id = "0",
      this.ada = "",
      this.amwayId = "3609999999907001",
      this.auditStatus,
      this.autoPublish,
      this.createTime = 0,
      this.description = "",
      this.displayAudits,
      this.medias,
      this.officialFlag,
      this.officialPgcId = "",
      this.products,
      this.publishStatus,
      this.title = ""});

  EditCircle.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ada = json['ada'];
    amwayId = json['amwayId'];
    auditStatus = json['auditStatus'];
    autoPublish = json['autoPublish'];
    createTime = json['createTime'];
    description = json['description'];
    if (json['displayAudits'] != null) {
      displayAudits = new List<DisplayAudits>();
      json['displayAudits'].forEach((v) {
        displayAudits.add(new DisplayAudits.fromJson(v));
      });
    }
    if (json['medias'] != null) {
      medias = new List<ImagesBean>();
      json['medias'].forEach((v) {
        medias.add(new ImagesBean.fromJson(v));
      });
    }
    officialFlag = json['officialFlag'];
    officialPgcId = json['officialPgcId'];
    if (json['products'] != null) {
      products = new List<Products>();
      json['products'].forEach((v) {
        products.add(new Products.fromJson(v));
      });
    }
    publishStatus = json['publishStatus'];
    title = json['title'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['ada'] = this.ada;
    data['amwayId'] = this.amwayId;
    data['auditStatus'] = this.auditStatus;
    data['autoPublish'] = this.autoPublish;
    data['createTime'] = this.createTime;
    data['description'] = this.description;
    if (this.displayAudits != null) {
      data['displayAudits'] =
          this.displayAudits.map((v) => v.toJson()).toList();
    }
    if (this.medias != null) {
      data['medias'] = this.medias.map((v) => v.toJson()).toList();
    }
    data['officialFlag'] = this.officialFlag;
    data['officialPgcId'] = this.officialPgcId;
    if (this.products != null) {
      data['products'] = this.products.map((v) => v.toJson()).toList();
    }
    data['publishStatus'] = this.publishStatus;
    data['title'] = this.title;
    return data;
  }
}

class DisplayAudits {
  int id;
  String data;
  int no;
  String propertyNameTip;
  String resourceType;
  String status;

  DisplayAudits(
      {this.id,
      this.data,
      this.no,
      this.propertyNameTip,
      this.resourceType,
      this.status});

  DisplayAudits.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    data = json['data'];
    no = json['no'];
    propertyNameTip = json['propertyNameTip'];
    resourceType = json['resourceType'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['data'] = this.data;
    data['no'] = this.no;
    data['propertyNameTip'] = this.propertyNameTip;
    data['resourceType'] = this.resourceType;
    data['status'] = this.status;
    return data;
  }
}

class Products {
  String approvalStatus;
  String itemSku;
  bool orderable;
  String pdpVideoUrl;
  String picture;
  PriceData priceData;
  String productCode;
  String productName;
  int skuAmount;
  String skuCode;
  String skuName;
  int skuUnitAmount;
  String skuUnitName;
  String specDescription;
  int specUnitAmount;
  String specUnitName;
  List<String> tagList;
  int unitAmount;
  String unitName;
  int updateTimestamp;

  Products(
      {this.approvalStatus,
      this.itemSku,
      this.orderable,
      this.pdpVideoUrl,
      this.picture,
      this.priceData,
      this.productCode,
      this.productName,
      this.skuAmount,
      this.skuCode,
      this.skuName,
      this.skuUnitAmount,
      this.skuUnitName,
      this.specDescription,
      this.specUnitAmount,
      this.specUnitName,
      this.tagList,
      this.unitAmount,
      this.unitName,
      this.updateTimestamp});

  Products.fromJson(Map<String, dynamic> json) {
    approvalStatus = json['approvalStatus'];
    itemSku = json['itemSku'];
    orderable = json['orderable'];
    pdpVideoUrl = json['pdpVideoUrl'];
    picture = json['picture'];
    priceData = json['priceData'] != null
        ? new PriceData.fromJson(json['priceData'])
        : null;
    productCode = json['productCode'];
    productName = json['productName'];
    skuAmount = json['skuAmount'];
    skuCode = json['skuCode'];
    skuName = json['skuName'];
    skuUnitAmount = json['skuUnitAmount'];
    skuUnitName = json['skuUnitName'];
    specDescription = json['specDescription'];
    specUnitAmount = json['specUnitAmount'];
    specUnitName = json['specUnitName'];
    tagList = json['tagList'].cast<String>();
    unitAmount = json['unitAmount'];
    unitName = json['unitName'];
    updateTimestamp = json['updateTimestamp'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['approvalStatus'] = this.approvalStatus;
    data['itemSku'] = this.itemSku;
    data['orderable'] = this.orderable;
    data['pdpVideoUrl'] = this.pdpVideoUrl;
    data['picture'] = this.picture;
    if (this.priceData != null) {
      data['priceData'] = this.priceData.toJson();
    }
    data['productCode'] = this.productCode;
    data['productName'] = this.productName;
    data['skuAmount'] = this.skuAmount;
    data['skuCode'] = this.skuCode;
    data['skuName'] = this.skuName;
    data['skuUnitAmount'] = this.skuUnitAmount;
    data['skuUnitName'] = this.skuUnitName;
    data['specDescription'] = this.specDescription;
    data['specUnitAmount'] = this.specUnitAmount;
    data['specUnitName'] = this.specUnitName;
    data['tagList'] = this.tagList;
    data['unitAmount'] = this.unitAmount;
    data['unitName'] = this.unitName;
    data['updateTimestamp'] = this.updateTimestamp;
    return data;
  }
}

class PriceData {
  String currency;
  int price;
  String saleStatus;
  int skuCode;

  PriceData({this.currency, this.price, this.saleStatus, this.skuCode});

  PriceData.fromJson(Map<String, dynamic> json) {
    currency = json['currency'];
    price = json['price'];
    saleStatus = json['saleStatus'];
    skuCode = json['skuCode'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['currency'] = this.currency;
    data['price'] = this.price;
    data['saleStatus'] = this.saleStatus;
    data['skuCode'] = this.skuCode;
    return data;
  }
}
